package com.gy.edu.news;

import android.widget.TextView;

import com.gy.edu.R;
import com.gy.edu.base.BaseActivity;
import com.gy.edu.news.adapter.NewsCommentAdapter;
import com.gy.edu.view.MyFullListView;

/**
 * 作者：gy on 16/12/22
 * 说明：资讯详情
 */
public class NewDetailActivity extends BaseActivity {

    private MyFullListView listView;
    private NewsCommentAdapter adapter;
    private TextView tvTitle,tvContent;
    private int position;
    private String[] contents;
    private String[] titles = new String[]{"习近平：把思想政治工作贯穿教育教学全过程","李克强：切实把职业教育摆在更加突出的位置",
            "全国高校实践育人暨创新创业现场推进会召开","现场作业凸显技能：全国包装设计职业技能现场大赛举办","增强自我发展能力——新疆建立职业教育对口帮扶长效机制",
            "高职院校财务人员探讨财务内部控制——钱怎么花才安全？","现代职业教育发展推进会召开","2017届全国普通高校毕业生就业创业工作网络视频会议召开",
            "李克强：抓紧建立公开透明的职业资格目录清单","教育部与六省（区）签署“一带一路”教育行动国际合作备忘录"};

    @Override
    protected void initView() {
        setContentViewRes(R.layout.activity_news_detail);
        setTitleMsg("资讯");
        listView = (MyFullListView) findViewById(R.id.news_detail_list);
        tvTitle = (TextView) findViewById(R.id.news_detail_title);
        tvContent = (TextView) findViewById(R.id.news_detail_content);
    }

    @Override
    protected void initData() {
        adapter = new NewsCommentAdapter(this);
        position = getIntent().getIntExtra("position",0);
        contents = new String[]{getString(R.string.new_detail_content1),getString(R.string.new_detail_content2),getString(R.string.new_detail_content3),
                getString(R.string.new_detail_content4),getString(R.string.new_detail_content5),getString(R.string.new_detail_content6),
                getString(R.string.new_detail_content7),getString(R.string.new_detail_content8),getString(R.string.new_detail_content9),
                getString(R.string.new_detail_content10)};
    }

    @Override
    protected void fillData() {
        super.fillData();
        listView.setAdapter(adapter);
        tvTitle.setText(titles[position]+"");
        tvContent.setText(contents[position]+"");
    }
}
